function IsWeixinOrAlipay() {
	var ua = window.navigator.userAgent.toLowerCase();
	//判断是不是微信
	if (ua.match(/MicroMessenger/i) == "micromessenger") {
		return "微信";
		console.log("微信")
	}
	//判断是不是支付宝
	if (ua.match(/AlipayClient/i) == "alipayclient") {
		return "支付宝";
		console.log("支付宝")
	}
	//哪个都不是
	return "啥也不是";
}
var index = new Vue({
	el: "#app",
	data: {
		s5,
		bannerList: '',
		lat: '',
		lon: '',
		shopList: '',
	},
	onload: {


	},
	//计算属性
	computed: {},
	//监听属性
	watch: {},
	//钩子函数
	created() {},
	mounted() {
		this.getConfig();
		this.findIndexBanner();
	},
	methods: {
		getConfig() {
			var that = this
			setTimeout(() => {
				var lng = localStorage.getItem("lng")
				var lat = localStorage.getItem("lat")
				s5.initData({
					url: '/stores-nearby',
					type: 'post',
					data: {
						lat: lat,
						lng: lng
					}
				}, (data) => {
					var dataList = JSON.parse(data)
					that.shopList = dataList.data.list
				})
			}, 500)


		},
		//获取数据
		findIndexBanner() {
			var that = this
			s5.initData({
				url: '/banner'
			}, (res) => {
				var data = JSON.parse(res)
				that.bannerList = data.data.list
			});
		},
		toGoodsDetail(id){
			window.location.href = "store-detail.html?id="+id
		}
	}
})

$(function() {
	new Swiper('.swiper-container', {
		autoplay: 3000,
		paginationClickable: true,
		speed: 300,
		observer: true, //修改swiper自己或子元素时，自动初始化swiper
		observeParents: true //修改swiper的父元素时，自动初始化swiper
	})
})
